From 9e3a08d891f085f5832f2141cc21f1374034dd20 Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 20 Oct 2006 14:44:58 +0000 Subject: [PATCH] Add explict unlink of position for realtime KML. --- kml.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kml.c b/kml.c index 3d6f94765..92a5e7fa8 100644 --- a/kml.c +++ b/kml.c @@ -278,6 +278,17 @@ kml_wr_deinit(void) fclose(ofd); if (posnfilenametmp) { +#if __WIN32__ + /* + * This is gross. + * Windows does not offer an atomic rename; we must + * explictly remove the destination here which exposes + * a window where a polled reader of this file could find + * the file to be missing. Windows readers will simply + * have to retry on this case. + */ + unlink(posnfilename); +#endif rename(posnfilenametmp, posnfilename); xfree(posnfilenametmp); posnfilenametmp = NULL; -- 2.30.2